﻿using UnityEngine;
using UnityEngine.UI;

public class MainMenuState : ISceneState
{
    public MainMenuState(SceneStateController controller) : base("02MainMenuScene", controller)
    {
    }

    public override void StateStart()
    {
        var canvas = GameObject.Find("Canvas").transform;
        var button = GameObject.Find("Canvas").transform.Find("StartButton");
        if (button != null) button.GetComponent<Button>().onClick.AddListener(OnStartButtonOnClick);
    }

    private void OnStartButtonOnClick()
    {
        mController.SetState(new BattleState(mController));
    }
}